home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / GMS / Dice / Includes / clib / games_protos.h
Encoding:
C/C++ Source or Header  |  1997-05-14  |  8.9 KB  |  255 lines

  1. #ifndef  CLIB_GAMES_PROTOS_H
  2. #define  CLIB_GAMES_PROTOS_H
  3.  
  4. /*
  5. **   $VER: games_protos.h V0.6B
  6. **
  7. **   C prototypes.
  8. **
  9. **   (C) Copyright 1996-1997 DreamWorld Productions.
  10. **       All Rights Reserved
  11. */
  12.  
  13. #ifndef  GAMES_GMS_H
  14. #include <games/games.h>
  15. #endif
  16.  
  17. #ifndef  EXEC_TYPES_H
  18. #include <exec/types.h>
  19. #endif
  20.  
  21. #ifndef  EXEC_TASKS_H
  22. #include <exec/tasks.h>
  23. #endif
  24.  
  25. /************************************************************************************
  26. ** Standard functions
  27. */
  28.  
  29. ULONG InitGPI(UWORD GPI_ID);
  30. ULONG RemoveGPI(UWORD GPI_ID);
  31. ULONG SetUserPrefs(char *PrefsName);
  32. void  CloseGMS(void);
  33. ULONG InitTags(APTR Structure, APTR TagList);
  34. struct GMSTask * FindGMSTask();
  35. void  GMSForbid(void);
  36. void  GMSPermit(void);
  37.  
  38. void  InitJoyPorts(void);
  39. ULONG ReadMouse(UWORD PortName);
  40. ULONG ReadJoyPort(UWORD PortName, UWORD ReturnType);
  41. ULONG ReadJoyStick(UWORD PortName);
  42. ULONG ReadJoyPad(UWORD PortName);
  43. ULONG ReadSegaPad(UWORD PortName);
  44. ULONG ReadAnalogue(UWORD PortName);
  45. ULONG ReadKey(struct Keys *);
  46. void  WaitLMB(void);
  47. void  WaitTime(UWORD MicroSeconds);
  48.  
  49. ULONG FastRandom(ULONG Range);
  50. ULONG SlowRandom(ULONG Range);
  51. APTR  WriteDec(LONG Number, LONG AmtDigits, char *Destination);
  52. APTR  WriteHex(LONG Number, LONG AmtDigits, char *Destination);
  53.  
  54. void  AddInputHandler(void);
  55. void  RemInputHandler(void);
  56. void  AddInterrupt(APTR Interrupt, UWORD IntNum, UWORD IntPri);
  57. void  RemInterrupt(APTR IntBase);
  58. APTR  AllocMemBlock(ULONG Size, ULONG MemType);
  59. void  FreeMemBlock(APTR MemBlock);
  60. ULONG AddTrack(ULONG Resource, ULONG Data, void *Routine);
  61. void  DeleteTrack(ULONG Key);
  62.  
  63. struct File * OpenFile(char *Filename, ULONG Flags);
  64. ULONG ReadFile(struct File *, APTR Buffer, ULONG Length);
  65. ULONG WriteFile(struct File *, APTR Buffer, ULONG Length);
  66. void  CloseFile(struct File *);
  67.  
  68. APTR  SmartLoad(char *FileName, APTR Destination, ULONG MemType);
  69. APTR  QuickLoad(char *FileName, APTR Destination, ULONG MemType);
  70. APTR  SmartUnpack(APTR Source, APTR Destination, ULONG Password, ULONG MemType);
  71. ULONG SmartSave(char *FileName, APTR Source, APTR SrcLength);
  72.  
  73. APTR  GetPicInfo(APTR PicHeader, struct Picture *);
  74. ULONG UnpackPic(APTR Source, struct Picture *);
  75. struct Picture * LoadPic(struct Picture *);
  76. struct Picture * LoadPicTags(unsigned long tag1Type, ...);
  77. struct Picture * LoadPicTagList(struct TagItem *);
  78. struct Picture * LoadPicFile(char *Filename, ULONG Options);
  79. void  FreePic(struct Picture *);
  80.  
  81. void InitDestruct(void *DestructCode, APTR DestructStack);
  82. void SelfDestruct(void);
  83. void Armageddon(ULONG Key);
  84. ULONG FingerOfDeath(struct GMSTask *);
  85.  
  86. APTR  GetPicture(void);
  87. APTR  GetStructure(ULONG ID);
  88. APTR  FreeStructure(APTR Structure);
  89.  
  90. APTR  LoadObjectFile(char *Filename);
  91. APTR  GetObject(APTR ObjectBase, char *Name);
  92. APTR  GetObjectList(APTR ObjectBase, APTR);
  93. void  FreeObjectFile(APTR ObjectBase);
  94. APTR  GrabObjectList(APTR ObjectBase);
  95. APTR  CopyOjbect(APTR ObjectBase, char *Name);
  96.  
  97. void  DebugMessage(ULONG Type, char *Text);
  98. void  ErrorMessage(ULONG ErrorCode);
  99. void  StepBack(void);
  100. ULONG DebugActive(void);
  101. void  DebugInactive(void);
  102. ULONG Awaken(struct GMSTask *);
  103.  
  104. /************************************************************************************
  105. ** Screens.GPI functions
  106. */
  107.  
  108. APTR  AllocVideoMem(ULONG Size);
  109. APTR  GetScreen(void);
  110. struct GameScreen * AddScreen(APTR GameScreen);
  111. struct GameScreen * AddScreenTags(unsigned long tag1Type, ...);
  112. struct GameScreen * AddScreenTagList(struct TagItem *);
  113. void  DeleteScreen(struct GameScreen *);
  114. void  ShowScreen(struct GameScreen *);
  115. APTR  HideScreen(struct GameScreen *);
  116. void  Switch(void);
  117. void  AutoSwitch(void);
  118. void  SwapBuffers(struct GameScreen *);
  119. void  WaitVBL(void);
  120. void  WaitRastLine(WORD LinePosition);
  121. void  RefreshScreen(struct GameScreen *);
  122. void  RemakeScreen(struct GameScreen *);
  123. void  MovePicture(struct GameScreen *);
  124. void  ResetPicture(struct GameScreen *);
  125.  
  126. /* Palette alteration functions */
  127.  
  128. void  UpdatePalette(struct GameScreen *);
  129. UWORD PaletteMorph(struct GameScreen *, UWORD FadeState, UWORD Speed,
  130.   ULONG StartColour, ULONG AmtColours, APTR SrcPalette, APTR DestPalette);
  131. UWORD PaletteToColour(struct GameScreen *, UWORD FadeState, UWORD Speed,
  132.   ULONG StartColour, ULONG AmtColours, APTR Palette, ULONG RRGGBB);
  133. UWORD ColourMorph(struct GameScreen *, UWORD FadeState, UWORD Speed,
  134.   ULONG StartColour, ULONG AmtColours, ULONG SrcColour, ULONG DestColour);
  135. UWORD ColourToPalette(struct GameScreen *, UWORD FadeState, UWORD Speed,
  136.   ULONG StartColour, ULONG AmtColours, APTR Palette, ULONG RRGGBB);
  137. void  ChangeColours(struct GameScreen *, UWORD FadeState, APTR Colours,
  138.   UWORD StartColour, UWORD AmtColours);
  139. void  BlankColours(struct GameScreen *);
  140.  
  141. /* Rasterlist functions */
  142.  
  143. ULONG InitRasterlist(struct GameScreen *);
  144. void  UpdateRasterlist(struct GameScreen *);
  145. void  UpdateRasterCommand(struct GameScreen *, APTR Command);
  146. void  UpdateRasterCommands(struct GameScreen *, APTR Command, UWORD Amount);
  147. void  UpdateRasterLines(struct GameScreen *);
  148. void  RemoveRasterlist(struct GameScreen *);
  149. void  HideRasterlist(struct GameScreen *);
  150. void  ShowRasterlist(struct GameScreen *);
  151.  
  152. /* Sprite functions */
  153.  
  154. struct Sprite * InitSprite(struct GameScreen *, struct Sprite *);
  155. struct Sprite * InitSpriteTags(struct GameScreen *, ULONG tag1Type, ...);
  156. struct Sprite * InitSpriteTagList(struct GameScreen *, struct TagItem *);
  157.  
  158. void  UpdateSprite(struct GameScreen *, struct Sprite *);
  159. void  MoveSprite(struct GameScreen *, struct Sprite *);
  160. void  HideSprite(struct GameScreen *, UWORD SpriteNum);
  161. void  UpdateSpriteList(APTR SpriteList);
  162. void  HideSpriteList(APTR SpriteList);
  163. void  RemoveAllSprites(void);
  164. void  ReturnAllSprites(void);
  165. void  FreeSprite(struct Sprite *);
  166.  
  167. void  UpdateColour(struct GameScreen *, ULONG Colour, ULONG Value);
  168. void  BlankOn(void);
  169. void  BlankOff(void);
  170. ULONG MoveToFront(struct GameScreen *);
  171. ULONG MoveToBack(struct GameScreen *);
  172. ULONG TakeDisplay(struct GameScreen *);
  173. struct GameScreen * ReturnDisplay(void);
  174.  
  175. void  FreeVideoMem(APTR MemBlock);
  176. APTR  GetSprite(void);
  177.  
  178. /************************************************************************************
  179. ** Blitter.GPI functions.
  180. */
  181.  
  182. APTR  AllocBlitMem(ULONG Size);
  183. APTR  GetBob(void);
  184. APTR  GetMBob(void);
  185. ULONG AllocBlitter(void);
  186. void  FreeBlitter(void);
  187. APTR  InitBob(struct GameScreen *, APTR Bob);
  188. APTR  InitBobTags(struct GameScreen *, ULONG tag1Type, ...);
  189. APTR  InitBobTagList(struct GameScreen *, struct TagItem *);
  190. void  FreeBob(APTR Bob);
  191. void  DrawBob(struct GameScreen *, APTR Bob, UWORD Buffer, struct Restorelist *);
  192. void  DrawBobList(struct GameScreen *, LONG *BobList[], UWORD Buffer, struct Restorelist *);
  193. void  ClearBob(struct GameScreen *, APTR Bob, UWORD Buffer);
  194. void  DrawLine(struct GameScreen *, UWORD Buffer, WORD StartX,
  195.         WORD StartY, WORD EndX, WORD EndY, ULONG Colour);
  196. void  DrawUCLine(struct GameScreen *, UWORD Buffer, UWORD StartX,
  197.         UWORD StartY, UWORD EndX, UWORD EndY, ULONG Colour);
  198.  
  199. void  CopyBuffer(struct GameScreen *, UWORD SrcBuffer, UWORD DestBuffer);
  200. void  ClrScreen(struct GameScreen *, UWORD Buffer);
  201. void  ClrArea(struct GameScreen *, UWORD StartX, UWORD StartY, UWORD EndX, UWORD EndY);
  202.  
  203. struct Restorelist * InitRestore(ULONG AmtBuffers, ULONG Entries);
  204. void  FreeRestore(struct Restorelist *);
  205. void  ResetRestore(struct Restorelist *);
  206. void  Restore(struct GameScreen *, struct Restorelist *);
  207. void  CleanUpRestore(struct GameScreen *, struct Restorelist *);
  208.  
  209. ULONG InitMap(struct GameScreen *, struct Map *);
  210. void  DrawMap(struct GameScreen *, struct Map *);
  211. void  DrawMapRow(struct GameScreen *, struct Map *);
  212. void  FreeMap(struct Map *);
  213. void  DrawMapTile(struct GameScreen *, struct Map *, WORD XCoord, WORD YCoord);
  214.  
  215. void  DrawPixel(struct GameScreen *, UWORD Buffer, WORD XCoord, WORD YCoord, ULONG Colour);
  216. void  DrawUCPixel(struct GameScreen *, UWORD Buffer, WORD XCoord, WORD YCoord, ULONG Colour);
  217. void  DrawPixelList(struct GameScreen *, UWORD Buffer, struct PixelList *);
  218. void  DrawUCPixelList(struct GameScreen *, UWORD Buffer, struct PixelList *);
  219. ULONG ReadPixel(struct GameScreen *, UWORD Buffer, WORD XCoord, WORD YCoord);
  220. void  ReadPixelList(struct GameScreen *, UWORD Buffer, struct PixelLIst *);
  221.  
  222. void  FreeBlitMem(APTR MemBlock);
  223.  
  224. /************************************************************************************
  225. ** Sound.GPI functions
  226. */
  227.  
  228. ULONG AllocAudio(void);
  229. void  FreeAudio(void);
  230. ULONG InitSound(APTR Sound);
  231. void  FreeSound(APTR Sound);
  232. UWORD CheckChannel(UWORD ChannelName);
  233.  
  234. void  PlaySound(APTR Sound);
  235. void  PlaySoundDAC1(APTR Sound);
  236. void  PlaySoundDAC2(APTR Sound);
  237. void  PlaySoundDAC3(APTR Sound);
  238. void  PlaySoundDAC4(APTR Sound);
  239. void  PlaySoundPri(APTR Sound);
  240. void  PlaySoundPriDAC1(APTR Sound);
  241. void  PlaySoundPriDAC2(APTR Sound);
  242. void  PlaySoundPriDAC3(APTR Sound);
  243. void  PlaySoundPriDAC4(APTR Sound);
  244.  
  245. void  SetVolume(UWORD Channel, UWORD Volume);
  246. void  FadeVolume(UWORD Channel);
  247. void  StopSound(struct Sound *);
  248. void  StopChannel(UWORD Channel);
  249.  
  250. APTR  AllocSoundMem(ULONG Size);
  251. APTR  GetSound(void);
  252. void  FreeSoundMem(APTR Memblock);
  253.  
  254. #endif /* CLIB_GAMES_PROTOS_H */
  255.